package kgc.crm.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.List;

/**
    * 部门表
    */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@TableName(value = "kgc_crm_admin_dept")
public class AdminDept extends Model<AdminDept> {
    @TableId(value = "dept_id", type = IdType.AUTO)
    private Integer deptId;

    /**
     * 父级ID 顶级部门为0
     */
    @TableField(value = "pid")
    private Integer pid;

    /**
     * 部门名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 排序 越大越靠后
     */
    @TableField(value = "num")
    private Integer num;

    /**
     * 部门备注
     */
    @TableField(value = "remark")
    private String remark;

    /**
     * 部门负责人
     */
    @TableField(value = "dept_head")
    private Integer deptHead;

    @TableField(exist = false)
    private List<AdminDept> children;

    @TableField(value = "userName")
    private String userName;

    public static final String COL_DEPT_ID = "dept_id";

    public static final String COL_PID = "pid";

    public static final String COL_NAME = "name";

    public static final String COL_NUM = "num";

    public static final String COL_REMARK = "remark";

    public static final String COL_DEPTHEAD = "dept_head";
}